<section>
	<div class="page_title">
		<h2 class="fl">权限分类列表</h2>
        <a class="fr top_rt_btn iconfont iconfont-jia1" href="{:U('admin/Auth/addAuthCate')}">添加权限分类</a>
	</div>
	<table class="table">
		<tbody>
		<tr>
			<th>权限分类名称</th>
			<th>操作</th>
		</tr>
		{volist name='modules' id='v'}
		<tr>
			<td>{$v.modulename}</td>
			<td>
				<div>
					<a class="green loadContent" href="{:U('admin/Auth/updateCate',array('id'=>encrypt_id($v.id)))}">
						<i class="iconfont iconfont-bianji inner_btn" style="color: #949496">&nbsp;编辑</i>
					</a>
					<a class="delCate loadContent" data-id="{:encrypt_id($v.id)}" href="javascript:void(0)">
						<i class="iconfont iconfont-shanchu inner_btn" style="color: #949496">&nbsp;删除</i>
					</a>
				</div>
			</td>
		</tr>
		{/volist}
		</tbody>
	</table>
	<aside class="paging">
		{$page.html}
	</aside>
</section>
<script type="text/javascript">

$(".delCate").click(function(){
	var id = $(this).data('id');
	msg({
		yes:'删除',
		no:'取消',
		txt:'确认删除?',
	},'question').then(function() {
		var send_data = {
			url:U('admin/Auth/deleteCate'),
			type:'POST',
			data:{
				id:id
			},
			dataType:'json',
		};
		send_ajax(send_data,function(response){
			if(response === false){
				DEBUG && admin.log(ajax_error);
				return false;
			}
			if(response.status == 1){
				msg_success(response.data.info,'',1000);
				setTimeout(function(){
					admin.getContentByUrl(response.data.jumpurl);
				},1000);
			}else{
				msg_error(response.message);
			}
			admin.log(response);
		});
	}, function(miss) {
		//dismiss can be 'cancel', 'overlay', 'close', 'timer'
		//if (miss === 'cancel') {
		//msg('你取消了')
		//}
	});
});
</script>